package com.lfb.homework;

import java.util.Collections;
import java.util.LinkedList;

public class HomeWork03 {
    public static void main(String[] args) {
        test01();
    }
    public static void test01(){
        LinkedList<String> linkedList = new LinkedList<String>();
        linkedList.add("apple");
        linkedList.add("grape");
        linkedList.add("banana");
        linkedList.add("pear");
        System.out.println("最大的元素为：" + Collections.max(linkedList));
        System.out.println("最小的元素为：" + Collections.min(linkedList));

        Collections.sort(linkedList);
        for (Object obj : linkedList){
            System.out.print(obj + "   ");
        }
    }
}
